from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from plone.app.layout.viewlets.common import ViewletBase, PersonalBarViewlet, SiteActionsViewlet
from plone.app.portlets.portlets.login import Renderer
from zope.component import getMultiAdapter
from Products.CMFCore.utils import getToolByName


class TchezopeSiteActionsViewlet(SiteActionsViewlet):
    """ SiteAction implementa o metodo render que sobrescreve a diretiva zcml
    """
    render = ViewPageTemplateFile('templates/site_actions.pt')



class TchezopePersonalBarViewlet(PersonalBarViewlet):
    """ PersonalBarViewlet implementa o metodo render que sobrescreve a diretiva zcml
    """

    _render = ViewPageTemplateFile('templates/personalbar.pt')

    def render(self):
        if not self.anonymous:
            return self._render()
        else:
            return u''
